package com.example.clientend.domain;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 远程被控端状态信息封装类
 * 该类用于被控端向主控端发送存活信息
 */
@Data
public class ComputerInfo implements Serializable {
    // mac地址，已弃用
    private String macAddress;
    // 公网ip，已弃用
    private String publicIP;
    // 存活信息发送时间
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date msgTime;
    // 本机当前远控状态
    private String status;
    // 远控程序安装硬盘信息
    private String hardDiskInfo;
    // 被控端连接MQTT的clientId
    private String deviceClientId;
    // 被控端设备名称
    private String deviceName;

    @Override
    public String toString() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String msgTimeFormat = sdf.format(msgTime);
        return "ComputerInfo{" +
                "macAddress='" + macAddress + '\'' +
                ", publicIP='" + publicIP + '\'' +
                ", msgTime=" + msgTimeFormat +
                ", status='" + status + '\'' +
                ", hardDiskInfo='" + hardDiskInfo + '\'' +
                ", deviceClientId='" + deviceClientId + '\'' +
                ", deviceName='" + deviceName + '\'' +
                '}';
    }
}
